<template>
  <div class="app-container">
    <!-- <div class="button-area">
      <el-button type="primary" @click="dialogFormVisible = true"
        >验收入库</el-button
      >
    </div> -->
    <div>
      <h1>出库</h1>
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="name" label="试剂名"> </el-table-column>
        <el-table-column prop="num" label="出库数量"> </el-table-column>
      </el-table>
      <div class="pagination-container">
        <el-pagination
          layout="prev, pager, next"
          :total="total"
          :page-size="pagesize"
          :current-page="page"
        >
        </el-pagination>
      </div>
    </div>
    <div>
      <h1>入库</h1>
      <el-table :data="tableData2" style="width: 100%">
        <el-table-column prop="name" label="试剂名"> </el-table-column>
        <el-table-column prop="num" label="入库数量"> </el-table-column>
      </el-table>
      <div class="pagination-container">
        <el-pagination
          layout="prev, pager, next"
          :total="total2"
          :page-size="pagesize2"
          :current-page="page2"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
import { listReagentStockLog } from '@/api/reagent/stockLog'

export default {
  name: 'Stocklog',
  data() {
    return {
      tableData: [],
      total: 0,
      page: 1,
      pagesize: 5,
      tableData2: [],
      total2: 0,
      page2: 1,
      pagesize2: 5,
    }
  },
  created() {
    this.getReagentStockLog()
    this.getReagentStockLog2()
  },
  methods: {
    loseFcous(index, row) {
      row.seen = false
    },
    getFcous(index, row) {
      row.seen = true
    },
    getReagentStockLog() {
      const self = this
      listReagentStockLog({
        pageNum: self.page,
        pageSize: self.pagesize,
        actionCode: 2,
      }).then((response) => {
        if (response && response.rows) {
          self.tableData = response.rows
        }
      })
    },
    getReagentStockLog2() {
      const self = this
      listReagentStockLog({
        pageNum: self.page2,
        pageSize: self.pagesize2,
        actionCode: 1,
      }).then((response) => {
        if (response && response.rows) {
          self.tableData2 = response.rows
        }
      })
    },
  },
}
</script>

<style></style>
